﻿/*
 * This software is the confidential and proprietary
 * information of NetBay
 * Such confidential information should not be disclosed
 * NetBay copyright(c) 2010
 */

#region Using
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.ServiceModel.DomainServices.Server;
using System.ComponentModel.DataAnnotations;
#endregion

namespace NetBay.Core.BusinessEntities
{
    [DataContract]
    public class OccurenciesByFolderType : ReturnObject
    {
        private OccurenciesForAllIndex m_oWithFilter;
        [Association("WithFilter", "ForeignKey1", "Key")]
        [Include]
        [DataMember]
        public OccurenciesForAllIndex WithFilter
        {
            get { return m_oWithFilter; }
            set 
            {
                m_oWithFilter = value;
                ForeignKey1 = m_oWithFilter.Key;
            }
        }

        private OccurenciesForAllIndex m_oWithoutFilter;
        [Association("WithoutFilter", "ForeignKey2", "Key")]
        [Include]
        [DataMember]
        public OccurenciesForAllIndex WithoutFilter
        {
            get { return m_oWithoutFilter; }
            set 
            { 
                m_oWithoutFilter = value;
                ForeignKey2 = m_oWithoutFilter.Key;
            }
        }

        public OccurenciesByFolderType()
        {
        }
        public OccurenciesByFolderType(Dictionary<long, Dictionary<long, List<string>>> p_oToPopulate)
        {
            WithFilter = new OccurenciesForAllIndex(p_oToPopulate[0]);
            WithoutFilter = new OccurenciesForAllIndex(p_oToPopulate[1]);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="FolderType"/> class for error usages
        /// </summary>
        /// <param name="errorMessage">The error message.</param>
        /// <param name="applicationException">The application exception.</param>
        public OccurenciesByFolderType(string errorMessage, Exception applicationException = null)
            : base(errorMessage, applicationException)
        {
        }
}
}
